package db.migrate;

import lombok.extern.slf4j.Slf4j;
import org.flywaydb.core.api.migration.BaseJavaMigration;
import org.flywaydb.core.api.migration.Context;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * 验证是否工作的脚本
 */
@Slf4j
public class V20230404160428__Migrate_Validation extends BaseJavaMigration {
    @Override
    public void migrate(Context context) throws SQLException {
        try (Statement select = context.getConnection().createStatement()) {
            try (ResultSet rows = select.executeQuery("SELECT 1")) {
                while (rows.next()) {
                    log.info("result: {}", rows.getInt(1));
                }
            }
        }
    }
}
